#include "../include/Link_List.h"

int main(int argc, char const *argv[])
{
    Element_data Admin_data[20] =
        {
            {.user = "张总", .sex = "男", .pas = "123", .age = 18, .id = 1, .id_rank = 1},
            {.user = "李总", .sex = "男", .pas = "123", .age = 18, .id = 2, .id_rank = 1},
            {.user = "王总", .sex = "男", .pas = "123", .age = 18, .id = 3, .id_rank = 1},
            {.user = "刘总", .sex = "男", .pas = "123", .age = 18, .id = 4, .id_rank = 1}
        };

    Element_data Staff_data[20] =
        {
            {.user = "小杨", .sex = "男", .pas = "123", .age = 18, .id = 1, .id_rank = 0},
            {.user = "小陈", .sex = "男", .pas = "123", .age = 18, .id = 2, .id_rank = 0},
            {.user = "小赵", .sex = "女", .pas = "123", .age = 18, .id = 3, .id_rank = 0},
            {.user = "小吴", .sex = "女", .pas = "123", .age = 18, .id = 4, .id_rank = 0},
            {.user = "小马", .sex = "女", .pas = "123", .age = 18, .id = 5, .id_rank = 0},
            {.user = "小牛", .sex = "女", .pas = "123", .age = 18, .id = 6, .id_rank = 0}
        };

    //======================= 创建链表 =======================
    // 创建管理员链表头节点
    Head_Node *Admin_Head = Init_Link_List();

    // 创建员工链表头节点
    Head_Node *Staff_Head = Init_Link_List();


    //======================= 录入信息 =======================
    // 录入管理员信息
    for (size_t i = 0; i < 4; i++)
    {
        Insert_Link_List(Admin_Head, Admin_data[i], i + 1);
    }

    // 录入员工信息
    for (size_t i = 0; i < 6; i++)
    {
        Insert_Link_List(Staff_Head, Staff_data[i], i + 1);
    }


    //======================= 登录界面 =======================
    // char in_user[20];
    // char in_pas[10];
    // int err;      // 判断错误次数
    // int sign = 0; // 退出按钮
    // int sign_1 = 0; // 退出switch
    // int flog = 0; // 是否登录成功
    // int mod = 0;  // 菜单页面模式选择
    // while (1)
    // {
    //     printf("请输入您的账号");
    //     scanf("%s", in_user);
    //     int Admin_id = Find_By_Name(Admin_Head , in_user);
    //     int Staff_id = Find_By_Name(Staff_Head , in_user);
        
    // }



    //======================= 销毁链表 =======================
    // 销毁管理员链表
    Free_Link_List(&Admin_Head);

    // 销毁员工链表
    Free_Link_List(&Staff_Head);


    /*========================================= Test =========================================*/
    {
        // 创建员工链表头节点
        // Head_Node * Staff_Head = Init_Link_List();

        //======================= 插入 =======================
        // Insert_Link_List(Admin_Head , data[0] , 1);
        // Insert_Link_List(Admin_Head , data[1] , 2);
        // Insert_Link_List(Admin_Head , data[2] , 3);
        // Printf_Link_List(Admin_Head);

        //======================= 删除 =======================
        // Del_Link_List(Admin_Head , 1);
        // Del_Link_List(Admin_Head , 2);
        // Printf_Link_List(Admin_Head);

        // //======================= 查找 =======================
        // int a = Find_By_Name(Admin_Head , "关羽");
        // printf("%d\n",a);

        //======================= 清空 =======================
        // Empty_Link_List(Admin_Head);
        // Printf_Link_List(Admin_Head);

        // //销毁管理员链表
        // Free_Link_List(&Admin_Head);
    }

    return 0;
}
